package com.tuju.jetpackfirstdemo.utils

import com.tuju.jetpackfirstdemo.data.PlaceRepository
import com.tuju.jetpackfirstdemo.data.WeatherRepository
import com.tuju.jetpackfirstdemo.network.CoolWeatherNetwork
import com.tuju.jetpackfirstdemo.ui.area.ChooseAreaModelFactory
import com.tuju.jetpackfirstdemo.ui.weather.WeatherModelFactory

object InjectorUtil {

    private fun getPlaceRepository() = PlaceRepository.getInstantce(CoolWeatherNetwork.getInstance()!!)

    private fun getWeatherRepository() = WeatherRepository.getInstance(CoolWeatherNetwork.getInstance()!!)

    fun getChooseAreaFactory() = ChooseAreaModelFactory(getPlaceRepository())

    fun getWeatherFactory() = WeatherModelFactory(getWeatherRepository())

}